package com.jk.lzy.controller;

import com.jk.lzy.model.EmpBean;
import com.jk.lzy.service.SumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

/**
 * @Author: 梁展艺
 * @Description:  消费者
 * @Date: 2021/5/16 19:09
 * @param null
 * @Return:
 **/
@Controller
@RequestMapping("sum")
public class SumController {
    @Autowired
    private SumService sumService;
    /**
     * @Author: 梁展艺
     * @Description:  分页 查询
     * @Date: 2021/5/16 19:35
     * @param emp
     * @Return: java.util.HashMap<java.lang.String,java.lang.Object>
     **/
    @RequestMapping("findEmp")
    @ResponseBody
    public HashMap<String,Object> findEmp(EmpBean emp){
        return sumService.findEmp(emp);
    }
    /**
     * @Author: 梁展艺
     * @Description:  新增
     * @Date: 2021/5/16 19:36
     * @param emp
     * @Return: void
     **/
    @RequestMapping("insertEmp")
    @ResponseBody
    public void  insertEmp(EmpBean emp){
        sumService.insertEmp(emp);
    }
    /**
     * @Author: 梁展艺
     * @Description:  删除
     * @Date: 2021/5/16 19:37
     * @param id
     * @Return: void
     **/
    @RequestMapping("deleteEmp")
    @ResponseBody
    public void deleteEmp(Integer id){
        sumService.deleteEmp(id);
    }
    /**
     * @Author: 梁展艺
     * @Description:  修改回显
     * @Date: 2021/5/16 19:39
     * @param id
     * @Return: com.jk.lzy.model.EmpBean
     **/
    @RequestMapping("updateEmpFindId")
    @ResponseBody
    public EmpBean updateEmpFindId(Integer id){
        return sumService.updateEmpFindId(id);
    }
}
